package com.zhkj.txg.module.order.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.zhkj.txg.R

class OrderDetailInfoAdapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_order_detail_info) {
    override fun convert(helper: BaseViewHolder, item: String) {
        if (item.isNotEmpty()) item.indexOf(":").takeIf { it > 0 }?.let {
            helper.setText(R.id.tvOrderDetailInfoType, item.substring(0, it + 1))
                .setText(R.id.tvOrderDetailInfoContent, item.substring(it + 1, item.length))
        }
    }
}